<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const hd = 'houdunren.com'
        console.log(/u/.test(hd))//检测u是否在里面


        const xyp = 'baidu.com'
        const dd = 'a';
        console.log(eval(`/${dd}/`).test(xyp))//dd 是变量，检测a是否在xyp变量里面
    </script>
</body>
</html>